import requests from '@/api/request'
// const SERVER_URL = 'web'
const SERVER_URL = ''
export default {
  // 查询
  queryByDictList (data) {
    return requests({
      url: `${SERVER_URL}/v1/api/backend/sysDict/queryByDictList`,
      method: 'post',
      data
    })
  },
  // 查询单条详情
  queryById (data) {
    return requests({
      url: `${SERVER_URL}/v1/api/backend/sysDict/queryById/${data}`,
      method: 'get'
    })
  },
  // 导出字典
  exportExcel (data) {
    return requests({
      url: `${SERVER_URL}/v1/api/backend/sysDict/exportExcel`,
      method: 'post',
      data
    })
  },
  // 模板导出
  templateExcel (data) {
    return requests({
      url: `${SERVER_URL}/v1/api/backend/sysDict/template/excel`,
      method: 'post',
      data
    })
  },
  // 导入字典
  postImport (data) {
    return requests({
      url: `${SERVER_URL}/v1/api/backend/sysDict/import`,
      method: 'post',
      data
    })
  },
  // 编辑字典
  postEdit (data) {
    return requests({
      url: `${SERVER_URL}/v1/api/backend/sysDict/edit`,
      method: 'post',
      data
    })
  },
  // 新增子字典
  addChildDict (data) {
    return requests({
      url: `${SERVER_URL}/v1/api/backend/sysDict/add/child`,
      method: 'post',
      data
    })
  },
  // 删除字典
  deleteDict (data) {
    return requests({
      url: `${SERVER_URL}/v1/api/backend/sysDict/deleteById/${data}`,
      method: 'delete'
    })
  }
}
